Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Serverless nav] Handle groups and vertical space #169251

Merged
merged 16 commits into from
Oct 23, 2023

Conversation

sebelga
Copy link
Contributor

@sebelga sebelga commented Oct 18, 2023

In this PR I've updated the Serverless side nav to handle better the different types of groups that we render in the navigation. I've also added a new spaceBefore prop to the node definition that allow consumer to customize the space between nodes.

If no space is provided the default is: we add a EUI "m" space before each of the group at level 1 of the tree. Those are the groups underneath the main collapsible item (with the icon shown when collapsed).

Note for reviewers

The best way to test is by openin the "Storybooks Preview" (link in CI status)

Group types - renderAs prop

A group renders differently based on the renderAs prop defined. This property accept the following values

  • block: This is the default is not specified. The group will render as a block of navigation links. No indent. If a title is provided then a bold title appears on top of the group.
  • accordion: As expected, this renders an accordion that can show/hide the links (or nested groups) underneath. Those do have an indent.
  • panelOpener: This group render as a link + an icon on the right. Clicking on the link opens a landing page. Clicking on the icon opens a panel on the right. The content of the panel can be auto-generated using the same navigation tree definition or a custom component can be provided by the consumer.
  • item: This group render exactly like any other items in the current list. This is useful if we want to declare descendant children of a node (and have those children nodes appear in the breadcrumb if they match the current URL location) but we don't want it to render as any of the above groups.

Screenshots

In the screenshot below, the vertical space between is the default space applied to level 1 groups.

Screenshot 2023-10-19 at 08 46 47 Screenshot 2023-10-19 at 08 50 17

Fixes #167323

@sebelga sebelga marked this pull request as ready for review October 19, 2023 08:20
@sebelga sebelga requested a review from a team as a code owner October 19, 2023 08:20
@sebelga sebelga requested a review from a team October 19, 2023 08:20
@sebelga sebelga requested review from a team as code owners October 19, 2023 08:20
@sebelga sebelga self-assigned this Oct 19, 2023
@sebelga sebelga added release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Project:Serverless Work as part of the Serverless project for its initial release labels Oct 19, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@sebelga sebelga requested a review from tsullivan October 19, 2023 08:21
Copy link
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presentation changes LGTM in the Storybook 👍

Oct-19-2023 08-21-39

Copy link
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, code review

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ML code changes LGTM
It's not possible to test the ML menus as no serverless project is currently using the ML default navigation.

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-only review. packages/default-nav/analytics/default_navigation.ts change LGTM.

Copy link
Contributor

@yngrdyn yngrdyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APM changes LGTM

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/core-chrome-browser 69 70 +1
@kbn/default-nav-analytics 7 8 +1
@kbn/default-nav-devtools 7 8 +1
@kbn/default-nav-management 7 8 +1
total +4

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolutionServerless 333.2KB 333.9KB +751.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolutionServerless 39.3KB 39.5KB +126.0B
serverlessObservability 59.7KB 60.5KB +863.0B
serverlessSearch 46.2KB 47.1KB +862.0B
total +1.8KB
Unknown metric groups

API count

id before after diff
@kbn/core-chrome-browser 163 164 +1
@kbn/default-nav-analytics 7 8 +1
@kbn/default-nav-devtools 7 8 +1
@kbn/default-nav-management 7 8 +1
total +4

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @sebelga

@sebelga sebelga merged commit 33fe17e into elastic:main Oct 23, 2023
@kibanamachine kibanamachine added v8.12.0 backport:skip This commit does not require backporting labels Oct 23, 2023
@sebelga sebelga deleted the serverless-chrome/grouping-and-spacing branch October 23, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Project:Serverless Work as part of the Serverless project for its initial release release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Serverless/SideNav] Need a way to group nav items under a bold group title, without an accordion